package com.goldman.oss.common.configuration;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;

import java.util.ArrayList;
import java.util.List;


@Data
@RefreshScope
@ConfigurationProperties(prefix = "common.oss")
public class OssCommonProperties {

    private List<AwsS3> awsS3 = new ArrayList<>();

    private List<HuaweiObs> huaweiObs = new ArrayList<>();

    /**
     * 华为云 OBS
     */
    @Data
    public static class HuaweiObs {
        /**
         * 启用
         */
        private Boolean enable = false;
        private String accessKey;
        private String secretKey;
        private String endPoint;
        private String bucketName;

        private String domain = "";
        private String businessCode = "";
        private String basePath = "";
        private Long defaultExpirationInSeconds = 60L;
    }

    /**
     * AWS S3
     */
    @Data
    public static class AwsS3 {
        /**
         * 启用
         */
        private Boolean enable = false;
        private String accessKey;
        private String secretKey;
        private String region;
        private String endPoint;
        private String bucketName;

        private String domain = "";
        private String businessCode = "";
        private String basePath = "";
        private Long defaultExpirationInSeconds = 60L;
    }

}
